﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Despertador
{
    public class Validacoes
    {
        public static bool validaHora(string hora)
        {
            int auxHora, auxMin, auxSeg;

            if (hora.Length >= 9)
                return false;
            try
            {

                auxHora = int.Parse(hora.Substring(0, 2));
                auxMin = int.Parse(hora.Substring(3, 2));
                auxSeg = int.Parse(hora.Substring(6, 2));
            }
            catch (Exception e)
            {
                return false;
            }

            if (auxHora > 24)
                return false;
            else if (auxMin > 59)
                return false;
            else if (auxSeg > 59)
                return false;


            return true;
        }
        public static int validaDia(String dia)
        {
            int diaSemana = 0;

            try
            {
                diaSemana = Int32.Parse(dia);
                return diaSemana;
            }
            catch
            {
                Console.Clear();
                Console.WriteLine("! Opção invalida !");
                Console.Clear();
                Console.ReadKey();
                return 10;
            }
        }


    }
}
